package com.ciwong.epaper.util.weakpassword;

public class config {
    /**
     * 密码口令检测对应系统等级
     * 保护系统级别 系统级别分为二级系统和三级系统
     * 当systemGrade不为2或者3时，系统默认使用系统级别2的规则
     * 当systemGrade设置为2或者3时，其他选项若未配置，则按照默认值处理，具体默认值信息见每一项说明
     */
    public static String SYSTEM_GRADE = "1";

    /**
     * 是否检测密码口令长度标识
     * 当checkPasswordLength为disable时，下面两项设置无效
     * 是否检测密码口令长度，如为enable则检测，如为disable则不检测，如为空，
     */
    public static String CHECK_PASSWORD_LENGTH = "enable";
    /**
     * 密码最小长度，默认为8
     * 允许密码口令最小长度
     */
    public static String MIN_LENGTH = "6";
    /**
     * 密码最大长度，默认为20
     * 允许密码口令最大长度，如为空，则不设置上限
     */
    public static String MAX_LENGTH = "20";

    /**
     * 是否包含数字
     */
    public static String CHECK_CONTAIN_DIGIT = "enable";
    /**
     * 是否区分大小写
     */
    public static String CHECK_DISTINGGUISH_CASE = "enable";
    /**
     * 是否包含小写字母
     */
    public static String CHECK_LOWER_CASE = "enable";
    /**
     * 是否包含大写字母
     */
    public static String CHECK_UPPER_CASE = "enable";
    /**
     * 是否包含特殊符号
     */
    public static String CHECK_CONTAIN_SPECIAL_CHAR = "disable";
    /**
     * 特殊符号集合
     */
    public static String DEFAULT_SPECIAL_CHAR = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";
    public static String SPECIAL_CHAR = DEFAULT_SPECIAL_CHAR;

    /**
     * 是否检测键盘按键横向连续
     */
    public static String CHECK_HORIZONTAL_KEY_SEQUENTIAL = "disable";
    /**
     * 键盘物理位置横向不允许最小的连续个数
     */
    public static String LIMIT_HORIZONTAL_NUM_KEY = "4";
    /**
     * 是否检测键盘按键斜向连续
     */
    public static String CHECK_SLOPE_KEY_SEQUENTIAL = "disable";
    ;
    /**
     * 键盘物理位置斜向不允许最小的连续个数
     */
    public static String LIMIT_SLOPE_NUM_KEY = "4";

    /**
     * 是否检测逻辑位置连续
     */
    public static String CHECK_LOGIC_SEQUENTIAL = "disable";
    /**
     * 密码口令中字符在逻辑位置上不允许最小的连续个数
     */
    public static String LIMIT_LOGIC_NUM_CHAR = "4";
    ;

    /**
     * 是否检测连续字符相同
     */
    public static String CHECK_SEQUENTIAL_CHAR_SAME = "enable";
    ;
    /**
     * 密码口令中相同字符不允许最小的连续个数
     */
    public static String LIMIT_NUM_SAME_CHAR = "4";

    /**
     * 键盘横向方向规则
     */
    public static String[] KEYBOARD_HORIZONTAL_ARR = {
            "01234567890",
            "qwertyuiop",
            "asdfghjkl",
            "zxcvbnm",
    };
    /**
     * 键盘斜线方向规则
     */
    public static String[] KEYBOARD_SLOPE_ARR = {
            "1qaz",
            "2wsx",
            "3edc",
            "4rfv",
            "5tgb",
            "6yhn",
            "7ujm",
            "8ik,",
            "9ol.",
            "0p;/",
            "=[;.",
            "-pl,",
            "0okm",
            "9ijn",
            "8uhb",
            "7ygv",
            "6tfc",
            "5rdx",
            "4esz"
    };

/*    static {
        if ("2".equals(SYSTEM_GRADE) || "3".equals(SYSTEM_GRADE)) {

            if ("".equals(CHECK_PASSWORD_LENGTH)) {
                CHECK_PASSWORD_LENGTH = "enable";
                MIN_LENGTH = "8";
                MAX_LENGTH = "20";
            }
            if ("".equals(CHECK_CONTAIN_DIGIT)) {
                CHECK_CONTAIN_DIGIT = "enable";
            }
            if ("".equals(CHECK_DISTINGGUISH_CASE)) {
                CHECK_DISTINGGUISH_CASE = "disable";
            }
            if ("".equals(CHECK_LOWER_CASE)) {
                CHECK_LOWER_CASE = "enable";
            }
            if ("".equals(CHECK_UPPER_CASE)) {
                CHECK_UPPER_CASE = "enable";
            }
            if ("".equals(CHECK_CONTAIN_SPECIAL_CHAR)) {
                if ("2".equals(SYSTEM_GRADE)) {
                    CHECK_CONTAIN_SPECIAL_CHAR = "disable";
                } else {
                    CHECK_CONTAIN_SPECIAL_CHAR = "enable";
                    if ("".equals(SPECIAL_CHAR)) {
                        SPECIAL_CHAR = DEFAULT_SPECIAL_CHAR;
                    }
                }
            }

            if ("".equals(CHECK_HORIZONTAL_KEY_SEQUENTIAL)) {
                CHECK_HORIZONTAL_KEY_SEQUENTIAL = "enable";
                if ("2".equals(SYSTEM_GRADE)) {
                    LIMIT_HORIZONTAL_NUM_KEY = "4";
                } else {
                    LIMIT_HORIZONTAL_NUM_KEY = "3";
                }
            }

            if ("".equals(CHECK_SLOPE_KEY_SEQUENTIAL)) {
                CHECK_SLOPE_KEY_SEQUENTIAL = "enable";
                if ("2".equals(SYSTEM_GRADE)) {
                    LIMIT_SLOPE_NUM_KEY = "4";
                } else {
                    LIMIT_SLOPE_NUM_KEY = "3";
                }
            }

            if ("".equals(CHECK_LOGIC_SEQUENTIAL)) {
                CHECK_LOGIC_SEQUENTIAL = "enable";
                if ("2".equals(SYSTEM_GRADE)) {
                    LIMIT_LOGIC_NUM_CHAR = "4";
                } else {
                    LIMIT_LOGIC_NUM_CHAR = "3";
                }

            }
            if ("".equals(CHECK_SEQUENTIAL_CHAR_SAME)) {
                CHECK_SEQUENTIAL_CHAR_SAME = "enable";
                if ("2".equals(SYSTEM_GRADE)) {
                    LIMIT_NUM_SAME_CHAR = "4";
                } else {
                    LIMIT_NUM_SAME_CHAR = "3";
                }
            }
        } else {
            SYSTEM_GRADE = "3";
            CHECK_PASSWORD_LENGTH = "enable";
            MIN_LENGTH = "6";
            MAX_LENGTH = "20";
            CHECK_CONTAIN_DIGIT = "enable";
            CHECK_LOWER_CASE = "enable";
            CHECK_UPPER_CASE = "enable";
            CHECK_CONTAIN_SPECIAL_CHAR = "enable";
            CHECK_HORIZONTAL_KEY_SEQUENTIAL = "enable";
            LIMIT_HORIZONTAL_NUM_KEY = "3";
            CHECK_SLOPE_KEY_SEQUENTIAL = "enable";
            LIMIT_SLOPE_NUM_KEY = "3";
            CHECK_LOGIC_SEQUENTIAL = "enable";
            LIMIT_LOGIC_NUM_CHAR = "3";
            CHECK_SEQUENTIAL_CHAR_SAME = "enable";
            LIMIT_NUM_SAME_CHAR = "3";
        }
    }*/
}
